From: emellor@ewan Date: Thu, 6 Oct 2005 09:16:50 +0000 (+0100) Subject: Issue diagnostic if we find dying domains on Xend restart, because we will not X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16763^2~29 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=6bee43e0b66777946ef8291fee82e4529f95a0ea;p=xen.git Issue diagnostic if we find dying domains on Xend restart, because we will not be able to show them any longer, as the paths in the store have gone. Don't call cleanupVm when a domain dies, as localhost-migrating VMs will be blown away by this (there is actually a race between the saving process and the resuming process). This fixes bug #276. Signed-off-by: Ewan Mellor --- diff --git a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py index b109ef69f2..39481573a0 100644 --- a/tools/python/xen/xend/XendDomain.py +++ b/tools/python/xen/xend/XendDomain.py @@ -146,7 +146,6 @@ class XendDomain: if info: del self.domains[domid] info.cleanupDomain() - info.cleanupVm() def refresh(self): @@ -161,25 +160,31 @@ class XendDomain: else: self._delete_domain(d.getDomid()) for d in doms: - if d not in self.domains and not doms[d]['dying']: - try: - dominfo = XendDomainInfo.recreate(doms[d]) - self._add_domain(dominfo) - except: - if d == PRIV_DOMAIN: - log.exception( - "Failed to recreate information for domain " - "%d. Doing nothing except crossing my " - "fingers.", d) - else: - log.exception( - "Failed to recreate information for domain " - "%d. Destroying it in the hope of " - "recovery.", d) - try: - xc.domain_destroy(dom = d) - except: - log.exception('Destruction of %d failed.', d) + if d not in self.domains: + if doms[d]['dying']: + log.error( + 'Cannot recreate information for dying domain %d. ' + 'Xend will ignore this domain from now on.', + doms[d]['dom']) + else: + try: + dominfo = XendDomainInfo.recreate(doms[d]) + self._add_domain(dominfo) + except: + if d == PRIV_DOMAIN: + log.exception( + "Failed to recreate information for domain " + "%d. Doing nothing except crossing my " + "fingers.", d) + else: + log.exception( + "Failed to recreate information for domain " + "%d. Destroying it in the hope of " + "recovery.", d) + try: + xc.domain_destroy(dom = d) + except: + log.exception('Destruction of %d failed.', d) ## public: